(function(KIT, RES) {
  /**
   * 导出Excel
   */
/*  var bindExportModelEvt = function() {
    $("#exportCst").on("click", function() {
      var _chckblist = $("#chkbltKeysEdit").checkboxlist();
      var _tvals = _chckblist.getValue().toString();
      var sub = _tvals.split(",");
      var sub2 = "";
      for(var i = 0; i < sub.length; i++) {

        if(sub[i] != "{2}") {
          sub2 += "'" + sub[i] + "',";
        }
      }
      sub2 = sub2.substring(0, sub2.length - 1);

      if(!rapid.isEmpty(_tvals)) {
        window.location.href = RES.URL_ROOT + "/dataModel/exportModelName?model=" + $("#queryModel").val() + '&_tvals=' + sub2;
      } else {
        rapid.info("请选择一个或多个字段。");
        return false;
      }

    });
  };*/
  /**
   * 查询模型字段名称
   */
  var bindSerchEvt = function() {
    $("#queryModel").change(function() {
      $("#exportCst").show();
      $("#txtPartyNameEdit").val($("#queryModel").val());
      var partylName = $("#queryModel").val();
      $("#chkbltKeysEdit").checkboxlist({
        name: "ATTRIB_20",
        valueField: "ATTRIB_NAME",
        textField: "ATTRIB_DESCN",
        size: 8,    //有多少列
        checked: false,
        dataSource: {
          transport: {
            url: RES.URL_ROOT + "/dataModel/getDataModelUDMKeyChooseByParty1",
            data: "partylName=" + partylName,
            success: function() {
              // KIT.fillForm("#frmModelUDMKeyEdit", null);
            }
          }
        }
      });
    });
  };

  rapid.Page.create()(function() {
    bindExportModelEvt();
    bindSerchEvt();
  }).init();
})(rapid.kit, rapid.res);

